<template>
  <view class="wanl-money">
    <view class="bg-orange padding-bj">
      <view class="" style="display: flex">
        <view class="" style="flex: 1">
          <text class="title">可提现佣金（元）</text>
          <view class="margin-top margin-bottom-xs">
            <text class="text-sl">{{ commission }}</text>
          </view>
        </view>

        <view class="" style="flex: 1">
          <text class="title">冻结佣金（元）</text>
          <view class="margin-top margin-bottom-xs">
            <text class="text-sl">{{ stay_commission }}</text>
          </view>
        </view>
      </view>
    </view>

    <!-- 功能 -->
    <view class="cu-list menu sm-border">
      <view class="cu-item arrow" @tap="$wanlshop.to('/pages/user/team/withdraw?commission=' + commission)">
        <view class="content">
          <text class="wlIcon-tixianjilu text-orange"></text>
          <text>提现</text>
        </view>
      </view>
    </view>
    <view class="cu-list menu sm-border">
      <view class="cu-item arrow" @tap="$wanlshop.to('/pages/user/bank/bank')">
        <view class="content">
          <text class="wlIcon-yinhangka text-blue"></text>
          <text>银行卡</text>
        </view>
        <view class="action">
          <text class="text-sm wanl-gray">用于提现到第三方账户</text>
        </view>
      </view>
      <!-- <view class="cu-item arrow" @tap="$wanlshop.to('/pages/user/money/list')">
				<view class="content">
					<text class="wlIcon-yue1 text-orange"></text>
					<text>账单明细</text>
				</view>
			</view>
			 -->
      <view class="cu-item arrow" @tap="$wanlshop.to('/pages/user/team/witlist')">
        <view class="content">
          <text class="wlIcon-jinbitixian text-orange"></text>
          <text>提现记录</text>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
import { mapState } from 'vuex';
export default {
  data() {
    return {
      commission: '0.00', //		可提现佣金
      stay_commission: '0.00', //	待入账佣金
    };
  },
  computed: {
    ...mapState(['user']),
  },
  onLoad(option) {
    this.stay_commission = option.stay_commission;
    this.commission = option.commission;

    this.loadData();
  },
  methods: {
    async loadData() {
      this.$api.post({
        url: '/wanlshop/pay/getBalance',
        success: res => {
          this.$store.commit('user/setUserInfo', { money: res });
        },
      });
    },
  },
};
</script>

<style>
.wanl-money .title {
  color: rgba(255, 255, 255, 0.7);
}
</style>
